﻿#pragma once
#include <QObject>
#include <QUrl>
#include <QSemaphore>
#include <QDebug>
#include <QTimer>
#include <QFile>

#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkRequest>
#include <QtNetwork/QNetworkReply>
#include <QtCore/QElapsedTimer>
#include <QtNetwork/QAuthenticator>

#include <opencv.hpp>


class Camera_onvif : public QObject
{
	Q_OBJECT

public:
	Camera_onvif(int id);
	~Camera_onvif();

	void snap();
	void busy(bool state);

private:
	void elapsed(QString msg);

	bool _busy = 0;
	QNetworkReply* reply = nullptr;

	int camera_id = 1;
	QElapsedTimer g_counter;

	QString camera_snap_uri;


signals:
	void sign_snap_rev(cv::Mat img);
};

